import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase10="DBshop010_处理退货信息"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'销售管理','退货管理')#进入退货管理
firefox.find_element_by_link_text('处理退货').click()  #选择处理退货
firefox.find_elements_by_id('"refund_state"')[0].click() #选择同意退货
firefox.find_element_by_id('refund_price').send_keys('2199') #金额选择2199
firefox.find_element_by_id("re_refund_info").send_keys('同意') #处理意见同意
firefox.find_element_by_xpath('//button[text()="提交处理结果"]').click()
print('后台完成')
time.sleep(2)
firefox.quit()
firefox=openBrowser(url)
DBshopLogin(firefox,userName,password)
firefox.find_element_by_link_text('用户中心').click()
firefox.find_element_by_link_text('退货申请').click()

try:
    firefox.find_element_by_xpath('//table/tbody/tr/td[4]').text=='退款成功'# 断言
    writeLog("%s 测试通过"%testCase10)
except:
    writeLog("%s 测试不同通过"%testCase10)
    getPhoto(firefox)
    firefox.quit()

